<template>
  <div>
    <half-banner :img="img" v-bind="bannerConfig" >
      <my-title :titleConfig="titleConfig" :titleData="titleData"></my-title>
    </half-banner>
  </div>
</template>
<script>
import halfBanner from "components/content/halfBanner/HalfBanner.vue";
import myTitle from "components/content/myTitle/MyTitle.vue";

import getTitle from "netWork/MyTitle";
export default {
  name: "TopBanner",
  props: {
    bannerConfig: {
      typeof: Object,
      default() {
        return {
          nanme:""
        };
      },
      
    },
    titleConfig: {
      typeof: Object,
      default() {
        return {
        };
      },
      
    },
  },
  components: {
    halfBanner,
    myTitle,
  },
    data() {
    return {
      img: "",
      titleData:{}
    };
  },
  created() {
    //获取标题模块数据
    getTitle().then((res) => {
      res.data[0]["webImg"] = JSON.parse(res.data[0]["webImg"])
      res.data[0]["motto"] = JSON.parse(res.data[0]["motto"]);
      //接收数据
      this.titleData = res.data[0];
       this.img = res.data[0].webImg[1];
    })
  },
};
</script>
<style scoped>
</style>